package com.job.liushuang.HomeWork0716;

import GaoYuXuan.Homework0714.Big;
import com.sun.deploy.uitoolkit.impl.awt.ui.SwingConsoleWindow;

import java.util.Scanner;

/**
 * @author Liushuang
 * @version 1.0
 * @since 2022-07-18 09:49:41
 */
public class CharCount {
    private static void BigChar(String str) {
        Character code;
        Integer count = null;
        StringBuffer buffer = new StringBuffer();
        // 转为char数组
        char[] ch = str.toCharArray();
        // 得到大写字母
        for (int i = 0; i < ch.length; i++) {
            if (ch[i] >= 'A' && ch[i] <= 'Z') {
                buffer.append(ch[i]);
                count++;
            }
        }
        // 倒序
        buffer = buffer.reverse();
        System.out.println("大写字母为："+buffer.toString()+"一共有"+count+"个");
    }
    //测试
    public static void main(String[] agrs) {
        System.out.println("请输入一串字符：");
        Scanner sc=new Scanner(System.in);
        String s = sc.next();
        BigChar(s);
    }
}